1. Field of the Invention
The present invention relates to an image decoding apparatus and an image decoding method.
2. Related Background Art
In an image decoding process, there is a case that a part of an image decoded in the past is used as a reference block to generate predictive image data, and the predictive image data is used for a picture being decoded at present.
A reference picture which is an image decoded in the past and is referred to is stored in a frame memory as a predetermined storage area on a storage device such as an SDRAM. The reference block is a part of the reference picture stored in the frame memory.
The reference block is defined in the reference picture by using motion vector information indicative of the positional relation between a picture being decoded at present and the reference picture, and is read. In some cases, however, the reference block is an area partly or entirely off from the proper reference picture area.
In such a case, image data is compensated by using a method called “padding”. After that, by performing a normal interpolating operation, a reference block is formed.
The padding is a method of copying each of the uppermost line, the lowermost line, the right end line, and the left end line of a reference picture, and adding the copied lines to peripheral areas of the reference picture to extend the reference picture to an area including the reference block, thereby enabling the reference block to be defined and read.
On the other hand, depending on the kind of a macro block being decoded at present, there is a case that a reference block has to be formed only by top lines or bottom lines.
In the case where the reference picture is stored in a frame structure in a frame memory, the reference picture on the frame memory has a structure in which top lines and bottom lines are alternately arranged. When the reference picture is stored in a field structure in a frame memory, the reference picture on the frame memory has a structure in which top lines (even-numbered lines) in a top area and bottom lines (odd-numbered lines) in a bottom area are arranged separately from each other.
Assuming the case where the reference block is constructed only by the top lines or only the bottom lines, by storing a reference picture as an image having the field structure on the frame memory, image data in either the top area or the bottom area can be read sufficiently. Therefore, it is effective in view of reduction in the amount of read data.
A data processing apparatus capable of generating predictive image data in short time even in the case where a motion vector indicates an area out of a valid pixel area in a reference picture has been proposed and known. The configuration of the data processing apparatus is employed on condition that a reference picture is stored in the frame structure (refer to, for example, Japanese Patent Application Laid-Open (JP-A) No. 2005-223631).
Pictures used as reference pictures may undergo different padding methods on the picture unit basis. Specifically, there are roughly two picture padding methods. In a first method, only the uppermost line and the lowermost line of a picture are padded on the uppermost and under the lowermost lines, respectively, of the picture (hereinbelow, called “I-line padding”). In a second method, two lines (the uppermost top line and the uppermost bottom line) from the upper end of a picture are alternately padded to areas on the picture, and two lines (the lowermost top line and the lowermost bottom line) from the bottom end of the picture are alternately padded to areas under the picture (hereinbelow, called “2-line padding”).
The uppermost top line is the uppermost line of the top lines in a reference picture, the uppermost bottom line is the uppermost line of the bottom lines in the reference picture, the lowermost top line is the lowermost line of the top lines in the reference picture, and the lowermost bottom line is the lowermost line of the bottom lines in the reference picture.
As described above, when the reference picture is stored as an image having a field structure on the frame memory, the amount of read data may be reduced and it is advantageous.
In this case, however, the conventional techniques have problems. Depending on the padding method applied, a reference block equivalent to that in the case where a reference picture is stored in the frame structure cannot be formed. It takes time longer than that in the case where a reference picture is stored in the frame structure.
The problems will be described by comparison between the case where a reference picture is stored in the frame structure and the case where a reference picture is stored in the field structure.
A case will be considered in which a reference picture is stored in the frame structure, the 2-line padding method is applied, and a reference block which is upwardly off from the uppermost top line of the reference picture is constructed only by the bottom line.
In this case, an area including a necessary number of a bottom line, the uppermost bottom line, and a copied uppermost bottom line is read from a frame memory together with a top line, the uppermost top line, and a copied uppermost top line, and is transferred, and only the necessary bottom lines are selectively used. In such a manner, a reference block constructed only by the bottom lines can be formed.
A configuration of forming a reference block by arranging the bottom line in the area of a reference picture and by arranging the copied uppermost bottom line on the outside of the area of the reference picture will be called a configuration X.
A case will be considered in which a reference picture is stored in the frame structure, the I-line padding method is applied, and a reference block which is upwardly off from the uppermost top line of the reference picture is constructed by the bottom line in the area of the reference picture and by the top line on the outside of the area of the reference picture.
In this case, an area including a necessary number of a bottom line and a copied uppermost top line is read from a frame memory together with a top line and the uppermost top line, and is transferred, and only the necessary bottom line and the copied uppermost top line are selectively used. In such a manner, a reference block constructed by the bottom line in the area of the reference picture and by the top line on the outside of the area of the reference picture can be formed.
A configuration of forming a reference block by arranging the bottom line in the area of a reference picture and by arranging the copied uppermost top line on the outside of the area of the reference picture will be called a configuration Y.
The cases where the reference picture is stored in the field structure will now be examined by comparison.
First, a case in which a reference picture is stored in the field structure and a reference block is constructed only by bottom lines will be considered. This case corresponds to the configuration X. Therefore, when the case is replaced with the case where the reference picture is stored in the frame structure, it corresponds to the case where the 2-line padding method is applied, and a reference block is constructed only by the bottom lines.
In the case where a reference picture is stored in the field structure, it is assumed that, basically, image data in the area of the reference picture is used.
Therefore, in the case of constructing a reference block only by bottom lines, an area including the uppermost bottom line and the bottom line in the area of the reference picture is read from the frame memory and transferred. With respect to a part on the outside of the area of the reference picture, image data is compensated by copying or address converting the read and transferred uppermost bottom line. In such a manner, a reference block constructed only by the bottom lines can be formed.
Therefore, in this case, even when a reference picture is stored in the field structure, no problem occurs. However, a problem occurs in the following case.
That is a case in which a reference block is constructed by bottom lines in the area of a reference picture and by top lines on the outside of the area of the reference picture when the reference picture is stored in the field structure. This case corresponds to the configuration Y. Therefore, When it is replaced with the case where a reference picture is stored in the frame structure, it is corresponds to the case in which the I-line padding method is applied, and a reference block is constructed by bottom lines in the area of the reference picture and by top lines on the outside of the area of the reference picture.
In this case as well, the area including the uppermost bottom line and the bottom line in the area of the reference picture is read from the frame memory and transferred.
However, with respect to a part on the outside of the area of a reference picture, no image data of the necessary uppermost top line exists, so that image data cannot be read and transferred together with the above-described read area.
Therefore, it is impossible to form a reference block only by image data obtained by a single reading/transferring operation.
On the other hand, when the number of the image data reading/transferring operations is not limited to only one and the uppermost top line to be copied to the part on the outside of the area of the reference picture is read and transferred from a top line storing area separated from a bottom line storing area, by copying the uppermost top line, a reference block can be formed.
However, in the above forming method, the image data reading/transferring operation for forming a reference block has to be performed twice, so that the number of process steps increases, and transfer overhead for transferring the uppermost top line occurs. Since the number of cycles for the image data reading/transferring operation increases, power consumption also increases.
As described above, in the method of storing a reference picture in the field structure and forming a reference block, the process has to be changed according to the kind of a picture at the time of reading and transferring of image data and at the time of forming a reference block. Therefore, the number of processes in the process of decoding image data increases. The increase in the number of processes causes enlargement of the gate scale in process circuits such as a data transfer/write circuit and a predictive image data generating circuit, and increase in the power consumption.
When formation of a reference block requiring the image data reading/transferring operation twice is performed frequently, there is the possibility that decoding cannot be performed within required decoding time.
Therefore, an image decoding apparatus and method is in demand, which requires an image data reading/transferring operation only once for forming a reference block irrespective of the kind of a picture while employing the configuration of storing a reference picture in the field structure in order to reduce the amount of read data at the time of forming a reference block.